package com.cyt.work.repair.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.wx.model.po.WxMember;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 资产报修-资产报修实体类
 *
 * @author han jun
 * @date 2019-7-8 15:03:04
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_asset_warranty")
public class AssetWarranty implements Serializable {

	/**
     * 主键ID
     */ 
	@Id
	private String id;

	/**
     * 模块ID
     */ 
	@Column(name = "apply_id")
	private String applyId;

	/**
     * 用户id
     */ 
	@Column(name = "user_id")
	private String userId;

	/**
     * 申请部门
     */ 
	@Column(name = "organ_name")
	@Excel(name = "申请部门", orderNum = "1")
	private String organName;

	/**
     * 手机号码
     */ 
	@Column(name = "mobile")

	@Excel(name = "联系方式", orderNum = "2")
	private String mobile;

	/**
     * 物品类型
     */ 
	@Column(name = "asset_type")
	@Excel(name = "物品类型", orderNum = "3")
	private String assetType;

	/**
     * 物品名称
     */ 
	@Column(name = "title")
	@Excel(name = "物品名称", orderNum = "4")
	private String title;

	/**
     * 物品地点
     */ 
	@Column(name = "location")
	@Excel(name = "物品地点", orderNum = "5")
	private String location;

	/**
     * 故障描述
     */ 
	@Column(name = "description")
	@Excel(name = "故障描述", orderNum = "6")
	private String description;

	/**
     * 图片的id
     */ 
	@Column(name = "object_id")
	private String objectId;

	/**
     * 状态
     */ 
	@Column(name = "asset_state")
	@Excel(name = "状态",replace = {"未解决_0", "已解决_1"},orderNum = "7")
	private String assetState;

	/**
     * 时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 是否删除：1-未删除；2-已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 更新人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
	 * 创建对象
	 *
	 * @param wxMember 当前用户信息
	 * @author han jun
	 * @date 2019-7-8 15:03:04
	 */
	public AssetWarranty(WxMember wxMember) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = wxMember.getId();
		this.updateTime = new Date();
		this.updateUser = wxMember.getId();
	}
}